package com.arcbbs.mapper;

import com.arcbbs.entity.FormBoard;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FormBoardMapper {
    @Select("select * from forum_board ORDER BY sort ASC;")
    List<FormBoard> selectall();
@Select("select * from forum_board where board_id = #{pBoardId}")
    FormBoard selectbyid(Integer pBoardId);
    @Select("select * from forum_board where p_board_id = #{pBoardId}")
    List<FormBoard> selectbyid1(Integer pBoardId);

    Page<FormBoard> page();
    @Select("select * from forum_board where p_board_id = 0")
    List<FormBoard> selectbypid();

    void update(FormBoard formBoard);


    void insert(FormBoard formBoard);
@Delete("delete  from forum_board where board_id = #{boardId}")
    void delete(Integer boardId);
}
